package com.kx.center.service;

import java.util.HashMap;
import java.util.List;

import com.kx.center.entity.Allocation;
import com.kx.center.entity.AllocationDetail;
import com.kx.center.entity.query.QueryAllocation;
import com.kx.center.entity.query.QueryResult;
import com.kx.center.exception.InventoryShortageException;

public interface AllocationService {
	public void insertAllocation(Allocation entity);
	public void insertAllocationDetail(AllocationDetail entity);
	public void updateAllocation(Allocation entity);
	public void updateAllocationDetail(AllocationDetail entity);
	
	public Allocation findAllocationById(Integer id);
	public Allocation findAllocationBySN(String sn);

	public List<Allocation> findAllocationByStoreId(Integer storeId);
	public List<Allocation> findAllocationByFromId(Integer storeId);
	public List<Allocation> findAllocationByToId(Integer storeId);
	public List<AllocationDetail> findAllocationDetailByAllocationId(Integer allocationId);

	public void saveAllocation(Integer from, Integer to, Integer allocationId, List<HashMap<String, Object>> json) throws InventoryShortageException;
	public void confirm(Allocation allocation) throws InventoryShortageException;
	
	public QueryResult queryAllocation(QueryAllocation query);
}
